package com.bwda.dsrs.systemservice.domain.vo.user;

import com.bwda.dsrs.base.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 用户信息
 *
 * @author yz
 * @date 2019/5/15
 */
@Data
@ApiModel(description = "用户表")
public class UserLoginVo {

    private Integer userId;

    @ApiModelProperty(value = "用户编码")
    private String userCode;

    @ApiModelProperty(value = "姓名")
    private String userName;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "0正常1冻结2离职3锁定4注销")
    private Integer userState;

    @ApiModelProperty(value = "0未删除 1已删除")
    private Integer delFlag;

    @ApiModelProperty(value = "首次密码")
    private String hisPwdOne;

    @ApiModelProperty(value = "锁定时间")
    @DateTimeFormat(pattern = DateUtil.FORMAT)
    private Date lockDate;

    public Date getLockDate() {
        if (lockDate != null){
            return (Date) lockDate.clone();
        }

        return null;
    }

    public void setLockDate(Date lockDate) {
        if (lockDate != null){
            this.lockDate = (Date) lockDate.clone();
        }
    }
}
